package com.kittlen.managementSystem.entity;

import java.io.Serializable;

public class Result<T> implements Serializable {

    public static final int RESULT_OK=0; //成功
    public static final String RESULT_OK_MSG="操作成功";
    public static final int RESULT_ERROR=-9999; //失败
    public static final String RESULT_ERROR_MSG="操作失败";

    private int code;//编码
    private T data;//数据
    private long count;//计数
    private String msg;//提示消息

    public Result() {
        this.code=RESULT_OK;
        this.msg=RESULT_OK_MSG;
    }

    public Result( T data,long count, String msg) {
        this(RESULT_OK,count,data,msg);
    }

    public Result(int code, long count, T data, String msg) {
        this.code = code;
        this.count = count;
        this.data = data;
        this.msg = msg;
    }

    public Result(T data, String msg) {
        this(RESULT_OK,0,data,msg);
    }

    public Result(String msg) {
        this(RESULT_OK,0,null,msg);
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }


    public long getCount() {
        return count;
    }

    public void setCount(long count) {
        this.count = count;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

}
